package nl.hu.verbrandendephoenix.client;

import java.util.ArrayList;

import nl.hu.verbrandendephoenix.shared.Auction;
import nl.hu.verbrandendephoenix.shared.Bid;
import nl.hu.verbrandendephoenix.shared.Conversation;
import nl.hu.verbrandendephoenix.shared.Message;
import nl.hu.verbrandendephoenix.shared.User;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * The async counterpart of <code>ServerService</code>.
 */
public interface ServerServiceAsync {
	//User
	void validLogin(String unm, AsyncCallback<Boolean> USR_EXISTS);
	void createUser(String unm, String pwd, String eml, AsyncCallback<Boolean> USR_CREATE);
	void loginUser(String unm, String pwd, AsyncCallback<String> asyncCallback);
	void getUserData(String key, AsyncCallback<User> asyncCallback);
	void getUserData(String key, String username, AsyncCallback<User> asyncCallback);
	void getUserID(String key, AsyncCallback<Integer> asyncCallback);
	void setUserData(String loginKey, User u, AsyncCallback<Boolean> asyncCallback);
	void searchUser(String strSearchInput, AsyncCallback<ArrayList<String>> asyncCallback);
	void blockUser(String loginKey, String username, AsyncCallback<Boolean> asyncCallback);
	void isAdmin(String loginKey, AsyncCallback<Boolean> asyncCallback);
	//Auction
	void searchAuction(String prodN, String minPrice, String maxPrice, String category, AsyncCallback<ArrayList<Auction>> asyncCallback);
	void getMyAuctions(String LoginKey, AsyncCallback<ArrayList<Auction>> asyncCallback);
	void createAuction(String text, String text2, int parseInt, String cookie, String itemText, AsyncCallback<Boolean> asyncCallback);
	void getAuctionData(int acID, AsyncCallback<Auction> asyncCallback);
	void getAuctionOwnerID(int acID, AsyncCallback<Integer> asyncCallback);
	void compareAuctionOwner(int acID, String LoginKey, AsyncCallback<Boolean> asyncCallback);
	void editAuction(int acID, Auction a, AsyncCallback<Boolean> asyncCallback);
	void deleteAuction(int acID, AsyncCallback<Boolean> asyncCallback);
	void checkCredits(int acID, String LoginKey, AsyncCallback<Boolean> asyncCallback);
	void payCredits(int acID, String LoginKey, AsyncCallback<Boolean> asyncCallback);
	void addCredits(int aantCreds, String LoginKey, AsyncCallback<Boolean> asyncCallback);
	void stopAuction(int acID, AsyncCallback<Boolean> asyncCallback);
	
	void getCategories(AsyncCallback<String[]> asyncCallback);
	//Bid
	void bidAuction(int acID, double price, String cookie, AsyncCallback<Boolean> asyncCallback);
	void getLatestOffer(int acID, AsyncCallback<Bid> asyncCallback);
	void getAllHighestBids(AsyncCallback<ArrayList<Bid>> asyncCallback);
	void getUserFromID(int userID, AsyncCallback<User> asyncCallback);
	void getAllBidsFromID(int parseInt, AsyncCallback<ArrayList<Bid>> asyncCallback);
	void checkForBid(int aucID, AsyncCallback<Boolean> asyncCallback);
	//Statistics
	void getTopAuctions(AsyncCallback<ArrayList<Auction>> asyncCallback);
	void getHighestBidDay(int day, int month, int year, AsyncCallback<Bid> asyncCallback);
	void getHighestBidMonth(int month, int year, AsyncCallback<Bid> asyncCallback);
	void getHighestBidYear(int year, AsyncCallback<Bid> asyncCallback);
	//Conversations
	void getConversations(User u, AsyncCallback<ArrayList<Conversation>> callback);
	void getConversationData(int index, AsyncCallback<Conversation> asyncCallback);
	void storeMessage(int index, String text, User current_User, User conv_partner, AsyncCallback<Message> asyncCallback);
	void checkActive(int acID, AsyncCallback<Boolean> asyncCallback);
	void getUserData(int acID, AsyncCallback<User> asyncCallback);
}